home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Periodicals / develop / develop 4 code / Poly. in Code Resources / Virtual WDEF / VirtualWorld.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-07-24  |  915 b   |  40 lines  |  [TEXT/MPS ]

  1. /*
  2.     VirtualWorld.h
  3.     
  4.     Interface to the Virtual world maintaining class.
  5.     
  6.     by Patrick Beard.
  7.     
  8.     ©1990 by Patrick C. Beard.  All rights reserved.
  9.  */
  10.  
  11. #ifndef __VIRTUALWORLD__
  12. #define __VIRTUALWORLD__
  13.  
  14. #include <Memory.h>
  15. #include <StdDef.h>
  16.  
  17. #include "Relocatable.h"
  18.  
  19. class VirtualWorld : public Relocatable {
  20. public:
  21.     VirtualWorld(Boolean worldFloats);    // constructor sets up world.
  22.     ~VirtualWorld();                    // destructor destroys it.
  23.     
  24.     // main functions, Enter sets A5 to point to our world.
  25.     void Enter();                        // go into our world.
  26.     void Leave();                        // restore old A5 context.
  27.     
  28.     // error reporting.
  29.     OSErr Result()    { return error; }
  30.  
  31. private:
  32.     OSErr error;                        // the last error that occurred.
  33.     Boolean codeFloats;                    // whether we have to call the vtable init.
  34.     long worldSize;                        // how big our globals are.
  35.     Ptr ourA5;                            // the storage for the virtual world.
  36.     Ptr oldA5;                            // old A5.
  37. };
  38.  
  39. #endif
  40.